﻿<!--
 * author : badqiu (badqiu@gmail.com)
-->
<html>
	<head>
		<META http-equiv="Content-Type" content="text/html; charset=utf08">
		<!-- prototype.js必需.effect.js是一个改善显示效果的库,可选. -->
		<script src="lib/prototype.js" type="text/javascript"></script>
		<script src="lib/effects.js" type="text/javascript"></script>
		<script src="lib/validation_cn.js" type="text/javascript"></script>
		<!-- 需要的样式文件 -->
		<link rel="stylesheet" type="text/css" href="/styles/style.css" />
	</head>
	<body>
		<form id='helloworld-form' action="#"  >
			验证不能为空,最小长度为15:</br>
			<!--通过class添加验证: required表示不能为空,min-length-15表示最小长度为15 -->
			<input type="text" name="age" class="required validate-integer min-length-0">
			<textarea name='content' class='max-length-10'></textarea></br>
			<input type='submit' value='Submit'/>
		</form>
		<!-- 添加表单验证,参数为表单ID -->
		<script>
			//var valid = new Validation('helloworld-form');
		</script>
		<script type="text/javascript">
			var valid = new Validation('helloworld-form', {onSubmit:true});
			// do something ...
			alert("x");
			var result = valid.validate();
		</script>		
		<div class="validation-advice">正在使用的样式</div>
		<div class="custom-advice1">提供的默认样式1</div>
		<div class="custom-advice2">提供的默认样式2</div>
	</body>
</html>